import request from "@/utils/request.js";

//易货大厅列表
export function BarterHall(params) {
  return request({
    url: "/goods/index",
    method: "get",
    params: params,
  });
}

//所有企业
export function CompanyAll(data) {
  return request({
    url: "/company/all",
    method: "post",
    data,
  });
}

//商品详情
export function GoodsDetail(params) {
  return request({
    url: "/goods/detail",
    method: "get",
    params: params,
  });
}

//收藏商品
export function CollectionCreate(data) {
  return request({
    url: "/collection/create",
    method: "post",
    data,
  });
}

//取消收藏
export function CollectionDelete(data) {
  return request({
    url: "/collection/delete",
    method: "post",
    data,
  });
}

//收藏列表
export function CollectionList(params) {
  return request({
    url: "/collection/index",
    method: "get",
    params: params,
  });
}

//浏览记录
export function HistoryList(params) {
  return request({
    url: "/history/index",
    method: "get",
    params: params,
  });
}

//关注粉丝
export function FanCreate(data) {
  return request({
    url: "/fan/create",
    method: "post",
    data,
  });
}

//取消关注粉丝
export function FanDelete(data) {
  return request({
    url: "/fan/delete",
    method: "post",
    data,
  });
}

//我的关注列表
export function FanAttention(params) {
  return request({
    url: "/fan/attention",
    method: "get",
    params: params,
  });
}

//我的粉丝列表
export function FanIndex(params) {
  return request({
    url: "/fan/index",
    method: "get",
    params: params,
  });
}

//商品评论
export function CommentIndex(params) {
  return request({
    url: "/comment/index",
    method: "get",
    params: params,
  });
}

//加入购物车
export function CartAdd(data) {
  return request({
    url: "/cart/add",
    method: "post",
    data,
  });
}

//购物车列表
export function CartIndex(params) {
  return request({
    url: "/cart/index",
    method: "get",
    params: params,
  });
}

//购物车删除
export function CartDelete(data) {
  return request({
    url: "/cart/delete",
    method: "post",
    data,
  });
}

//购物车数量修改
export function SetQuantity(data) {
  return request({
    url: "/cart/set_quantity",
    method: "post",
    data,
  });
}

//下单 
export function OrderCreate(data) {
  return request({
    url: "/order/create",
    method: "post",
    data,
  });
}

//获取费率信息 
export function OrderFeeRatio(params) {
  return request({
    url: "/order/fee_ratio",
    method: "get",
    params:params
  });
}

//易链值支付
export function ByChainMoney(data) {
  return request({
    url: "/pay/pay_order_by_chain_money",
    method: "post",
    data,
  });
}
//转账支付 
export function TransferForGuarantee(data) {
  return request({
    url: "/pay/transfer_for_guarantee",
    method: "post",
    data,
  });
}